package o;

import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Bundle;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class edc {
    private static final Object ˊ = new Object();
    private static edc ˋ;
    private int ʼ;
    @SuppressLint({"UseSparseArrays"})
    private final Map<Integer, Bundle> ˎ = new HashMap();
    private final Context ˏ = ContentManager.getInstant().getContext();
    @SuppressLint({"UseSparseArrays"})
    private final Map<Integer, b> ॱ = new HashMap();

    public interface b {
        void ˋ(boolean z, Bundle bundle);
    }

    private edc() {
    }

    public static edc ˋ() {
        edc o_edc;
        synchronized (ˊ) {
            if (ˋ == null) {
                ˋ = new edc();
            }
            o_edc = ˋ;
        }
        return o_edc;
    }

    private synchronized int ˎ() {
        int i;
        i = this.ʼ + 1;
        this.ʼ = i;
        return i;
    }

    public synchronized void ॱ(b bVar, int i, Bundle bundle, String[] strArr) {
        ˏ(bVar, i, bundle, false, strArr);
    }

    public synchronized void ˏ(b bVar, int i, Bundle bundle, boolean z, String[] strArr) {
        List ˊ = edd.ˊ(this.ˏ, strArr);
        if (!ˊ.isEmpty()) {
            int ˎ = ˎ();
            String[] strArr2 = (String[]) ˊ.toArray(new String[0]);
            this.ॱ.put(Integer.valueOf(ˎ), bVar);
            this.ˎ.put(Integer.valueOf(ˎ), bundle);
            edd.ॱ(this.ˏ, i, ˎ, z, strArr2);
        }
    }

    public synchronized void ॱ(int i, int[] iArr) {
        b bVar = (b) this.ॱ.get(Integer.valueOf(i));
        Bundle bundle = (Bundle) this.ˎ.get(Integer.valueOf(i));
        boolean ˊ = edd.ˊ(iArr);
        if (bVar != null) {
            bVar.ˋ(ˊ, bundle);
        }
        this.ॱ.remove(Integer.valueOf(i));
        this.ˎ.remove(Integer.valueOf(i));
    }
}
